<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Tolc: app/admin/rte/ajax_load_page_version.php Source File</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../tolc_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Tolc
   &#160;<span id="projectnumber">v 1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../files.html"><span>File&#160;List</span></a></li>
      <li><a href="../../globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d9/d37/ajax__load__page__version_8php_source.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">ajax_load_page_version.php</div>  </div>
</div><!--header-->
<div class="contents">
<a href="../../d9/d37/ajax__load__page__version_8php.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;&lt;?php</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;session_start();</div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;session_regenerate_id();</div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;</div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">// prevent direct access</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#ad847b1d5d75085490c4954a4b94521a1">    6</a></span>&#160;<a class="code" href="../../d2/d6e/ajax__about__form_8php.html#ad847b1d5d75085490c4954a4b94521a1">$isAjax</a> = isset($_SERVER[<span class="stringliteral">&#39;HTTP_X_REQUESTED_WITH&#39;</span>]) AND</div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;        strtolower($_SERVER[&#39;HTTP_X_REQUESTED_WITH&#39;]) === &#39;xmlhttprequest&#39;;</div>
<div class="line"><a name="l00008"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a2110cc584fcd9b40af2653f0d4379d91">    8</a></span>&#160;<a class="code" href="../../d2/d6e/ajax__about__form_8php.html#a41b422ef9d6a2d7fe4a25345ef237e77">if</a>(!<a class="code" href="../../d2/d6e/ajax__about__form_8php.html#ad847b1d5d75085490c4954a4b94521a1">$isAjax</a>) {</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;        print <span class="stringliteral">&#39;Access denied - not an AJAX request...&#39;</span> . <span class="stringliteral">&#39; (&#39;</span> . __FILE__ . <span class="charliteral">&#39;)&#39;</span>;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;        exit;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;}</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;</div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;require_once <span class="stringliteral">&#39;../../conf/settings.php&#39;</span>;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;require_once <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>[<span class="stringliteral">&#39;project_dir&#39;</span>] . <span class="stringliteral">&#39;/app/common/init.php&#39;</span>;</div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;require_once <a class="code" href="../../d6/d75/init_8php.html#a9d247c19a0245a28a9363b9ded3df8e4">ADODB_PATH</a> . <span class="stringliteral">&#39;/adodb.inc.php&#39;</span>;</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;require_once <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>[<span class="stringliteral">&#39;project_dir&#39;</span>] . <span class="stringliteral">&#39;/app/common/utils_db.php&#39;</span>;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;require_once <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>[<span class="stringliteral">&#39;project_dir&#39;</span>] . <span class="stringliteral">&#39;/app/common/utils.php&#39;</span>;</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;require_once <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>[<span class="stringliteral">&#39;project_dir&#39;</span>] . <span class="stringliteral">&#39;/app/common/utils_cms.php&#39;</span>;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;require_once <a class="code" href="../../d6/d75/init_8php.html#a3c5913f67696e5b4eef1a14b19653629">SIMPLE_HTML_DOM_PATH</a> . <span class="stringliteral">&#39;/simple_html_dom.php&#39;</span>;</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">// check for logged in user</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keywordflow">if</span>(!isset(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a395f20d5378de643ef8d64e86d6bba9a">$_SESSION</a>[<span class="stringliteral">&#39;username&#39;</span>])) {</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        print <a class="code" href="../../d6/d75/init_8php.html#a81e77acabb46663453c3b6d17082bf6b">CONST_ACCESS_DENIED</a> . <span class="stringliteral">&#39; (&#39;</span> . __FILE__ . <span class="charliteral">&#39;)&#39;</span>;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;        exit;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;}</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="comment">// get current time (in UTC)</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a749423b4cd05e9c9af3474b05bec92c2">   28</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a749423b4cd05e9c9af3474b05bec92c2">$dt</a> = <a class="code" href="../../d8/dfd/utils_8php.html#af4a2ee0fcc1938603a0df8cb02e51fbd">now</a>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a395f20d5378de643ef8d64e86d6bba9a">$_SESSION</a>[<span class="stringliteral">&#39;user_timezone&#39;</span>]);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment">// get vars</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a2ee0dbecb1c2b92cf425284093e0542d">   31</a></span>&#160;<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a2ee0dbecb1c2b92cf425284093e0542d">$www_pages_id</a> = $_POST[<span class="stringliteral">&#39;www_pages_id&#39;</span>];</div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aaf6b59bede49d73754040dbdb1ec28e4">   32</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aaf6b59bede49d73754040dbdb1ec28e4">$www_page_versions_id</a> = $_POST[<span class="stringliteral">&#39;www_page_versions_id&#39;</span>];</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="comment">// connect to database</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">   35</a></span>&#160;<a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a> = <a class="code" href="../../d2/d1c/utils__db_8php.html#a9130b08511e6b3e5efd303a8cb48b4e8">get_db_conn</a>(<a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>[<span class="stringliteral">&#39;dbdriver&#39;</span>]);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment">// init</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a8ada2a3347c63cf1058071243b769c6c">   38</a></span>&#160;<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a8ada2a3347c63cf1058071243b769c6c">$user_tz</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a395f20d5378de643ef8d64e86d6bba9a">$_SESSION</a>[<span class="stringliteral">&#39;user_timezone&#39;</span>];</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#ab74db288cd92349906022ba161ff1043">   39</a></span>&#160;<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ab74db288cd92349906022ba161ff1043">$user_df_php_datetime</a> = <a class="code" href="../../d6/d75/init_8php.html#a5fdabd46dd0a8f5395fbca2f2de9302d">$a_date_format</a>[<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a395f20d5378de643ef8d64e86d6bba9a">$_SESSION</a>[<span class="stringliteral">&#39;user_dateformat&#39;</span>]][<span class="stringliteral">&#39;php_datetime&#39;</span>];</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a021631687090fc455607ae336ebc3b54">   40</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a> = array();</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#ab7d298e479fe6080b840eb3e44be9039">   42</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#ab7d298e479fe6080b840eb3e44be9039">$a_content_status_keys</a> = array(</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a93e5d98e1cb4a87c32a3b60666ec29d9">CONST_CONTENT_STATUS_DRAFT_KEY</a>,</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a7f8ee6799f4d346516d60716aefa01fc">CONST_CONTENT_STATUS_PENDING_REVIEW_KEY</a>,</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a3178998c1b4b9effba542d3cbeb3468c">CONST_CONTENT_STATUS_UNDER_REVIEW_KEY</a>,</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a343771fe85c1e04422dfad48c26900b4">CONST_CONTENT_STATUS_APPROVED_KEY</a>,</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a5afee9294ada0317a39b5f58472c2115">CONST_CONTENT_STATUS_REJECTED_KEY</a></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;);</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;</div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aac299996d4de21e8bce2663b75f7f1c1">   50</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aac299996d4de21e8bce2663b75f7f1c1">$a_content_status_values</a> = array(</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#aeb76e285c6b9e4bfcc3f8c05acfa808b">CONST_CONTENT_STATUS_DRAFT_VALUE</a>,</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a79993d164d0567a3ae299dc14cb4c3e8">CONST_CONTENT_STATUS_PENDING_REVIEW_VALUE</a>,</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#ae50ba4a026aeaf0c38096e1dc640813e">CONST_CONTENT_STATUS_UNDER_REVIEW_VALUE</a>,</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a51f41c08e46f02df6d59cfd6c4ea4249">CONST_CONTENT_STATUS_APPROVED_VALUE</a>,</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a003e3e7e121b962a56f046a9513bf8f8">CONST_CONTENT_STATUS_REJECTED_VALUE</a></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;);</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a75dbf76c56d09cf17ff2168c80e91220">   58</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a75dbf76c56d09cf17ff2168c80e91220">$a_content_status</a> = array(</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a93e5d98e1cb4a87c32a3b60666ec29d9">CONST_CONTENT_STATUS_DRAFT_KEY</a> =&gt; <a class="code" href="../../d6/d75/init_8php.html#aeb76e285c6b9e4bfcc3f8c05acfa808b">CONST_CONTENT_STATUS_DRAFT_VALUE</a>,</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a7f8ee6799f4d346516d60716aefa01fc">CONST_CONTENT_STATUS_PENDING_REVIEW_KEY</a> =&gt; <a class="code" href="../../d6/d75/init_8php.html#a79993d164d0567a3ae299dc14cb4c3e8">CONST_CONTENT_STATUS_PENDING_REVIEW_VALUE</a>,</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a3178998c1b4b9effba542d3cbeb3468c">CONST_CONTENT_STATUS_UNDER_REVIEW_KEY</a> =&gt; <a class="code" href="../../d6/d75/init_8php.html#ae50ba4a026aeaf0c38096e1dc640813e">CONST_CONTENT_STATUS_UNDER_REVIEW_VALUE</a>,</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a343771fe85c1e04422dfad48c26900b4">CONST_CONTENT_STATUS_APPROVED_KEY</a> =&gt; <a class="code" href="../../d6/d75/init_8php.html#a51f41c08e46f02df6d59cfd6c4ea4249">CONST_CONTENT_STATUS_APPROVED_VALUE</a>,</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a5afee9294ada0317a39b5f58472c2115">CONST_CONTENT_STATUS_REJECTED_KEY</a> =&gt; <a class="code" href="../../d6/d75/init_8php.html#a003e3e7e121b962a56f046a9513bf8f8">CONST_CONTENT_STATUS_REJECTED_VALUE</a></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;);</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#abcaa38a389fb572018ed3d050209615c">   66</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#abcaa38a389fb572018ed3d050209615c">$a_content_status_css</a> = array(</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a93e5d98e1cb4a87c32a3b60666ec29d9">CONST_CONTENT_STATUS_DRAFT_KEY</a> =&gt; <span class="stringliteral">&#39;status_draft&#39;</span>,</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a7f8ee6799f4d346516d60716aefa01fc">CONST_CONTENT_STATUS_PENDING_REVIEW_KEY</a> =&gt; <span class="stringliteral">&#39;status_pending_review&#39;</span>,</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a3178998c1b4b9effba542d3cbeb3468c">CONST_CONTENT_STATUS_UNDER_REVIEW_KEY</a> =&gt; <span class="stringliteral">&#39;status_under_review&#39;</span>,</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a343771fe85c1e04422dfad48c26900b4">CONST_CONTENT_STATUS_APPROVED_KEY</a> =&gt; <span class="stringliteral">&#39;status_approved&#39;</span>,</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <a class="code" href="../../d6/d75/init_8php.html#a5afee9294ada0317a39b5f58472c2115">CONST_CONTENT_STATUS_REJECTED_KEY</a> =&gt; <span class="stringliteral">&#39;status_rejected&#39;</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="comment">// get current user ------------------------------------------------------------</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a649f354de024fb2775f5f95d607a5151">   75</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a649f354de024fb2775f5f95d607a5151">$a_user</a> = <a class="code" href="../../d6/dfd/utils__cms_8php.html#a899c67acb078ad12251b58324cf23ad0">get_user</a>(<a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>, $_SESSION[<span class="stringliteral">&#39;username&#39;</span>]);</div>
<div class="line"><a name="l00076"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a474a7ef24f527d87a414664d5aadc37f">   76</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a474a7ef24f527d87a414664d5aadc37f">$www_users_id</a> = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a649f354de024fb2775f5f95d607a5151">$a_user</a>[<span class="stringliteral">&#39;user_id&#39;</span>];</div>
<div class="line"><a name="l00077"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a57b5c55362af42165645752e1593d407">   77</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a57b5c55362af42165645752e1593d407">$lk_roles_id</a> = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a649f354de024fb2775f5f95d607a5151">$a_user</a>[<span class="stringliteral">&#39;lk_roles_id&#39;</span>];</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="comment">// get current version ---------------------------------------------------------</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">   80</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a> = array();</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="keywordflow">if</span>(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aaf6b59bede49d73754040dbdb1ec28e4">$www_page_versions_id</a> &gt; 0) {</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT author_id,date_publish_start,date_publish_end,lk_content_status_id,editor_id FROM www_page_versions WHERE id=&#39;</span> . <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aaf6b59bede49d73754040dbdb1ec28e4">$www_page_versions_id</a>;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;GetRow(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;        }</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a> = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        <span class="comment">// decode dates</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        $d = <a class="code" href="../../d8/dfd/utils_8php.html#a741e472b16682ea77137ca19054c17b8">date_decode</a>(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;date_publish_start&#39;</span>], <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a8ada2a3347c63cf1058071243b769c6c">$user_tz</a>, <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ab74db288cd92349906022ba161ff1043">$user_df_php_datetime</a>);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;date_publish_start&#39;</span>] = $d;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        $d = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;date_publish_end&#39;</span>];</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        <span class="keywordflow">if</span>($d &gt; 0) {</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;                $d = <a class="code" href="../../d8/dfd/utils_8php.html#a741e472b16682ea77137ca19054c17b8">date_decode</a>(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;date_publish_end&#39;</span>], <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a8ada2a3347c63cf1058071243b769c6c">$user_tz</a>, <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ab74db288cd92349906022ba161ff1043">$user_df_php_datetime</a>);</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;                <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;date_publish_end&#39;</span>] = $d;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        <span class="comment">// null values</span></div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        <span class="keywordflow">if</span>(is_null(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;date_publish_end&#39;</span>])) {</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;date_publish_end&#39;</span>] = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        }</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <span class="keywordflow">if</span>(is_null(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;editor_id&#39;</span>])) {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;                <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>[<span class="stringliteral">&#39;editor_id&#39;</span>] = 0;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;        }</div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a774c4d95eadc24fc785649b5b576a608">  104</a></span>&#160;} <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a> = array(</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;                        <span class="stringliteral">&#39;author_id&#39;</span> =&gt; <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a474a7ef24f527d87a414664d5aadc37f">$www_users_id</a>,</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;                        <span class="stringliteral">&#39;date_publish_start&#39;</span> =&gt; <span class="stringliteral">&#39;&#39;</span>,</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;                        <span class="stringliteral">&#39;date_publish_end&#39;</span> =&gt; <span class="stringliteral">&#39;&#39;</span>,</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;                        <span class="stringliteral">&#39;lk_content_status_id&#39;</span> =&gt; <a class="code" href="../../d6/d75/init_8php.html#a93e5d98e1cb4a87c32a3b60666ec29d9">CONST_CONTENT_STATUS_DRAFT_KEY</a>,</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;                        <span class="stringliteral">&#39;editor_id&#39;</span> =&gt; 0</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        );</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div>
<div class="line"><a name="l00114"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#abe7ab20f185be4e9ce9b5a59956c07f3">  114</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;current_version&#39;</span>] = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7c4035346b933243506b4584953afd74">$a_current_version</a>;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="comment">// get page versions -----------------------------------------------------------</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="keywordflow">if</span>(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aaf6b59bede49d73754040dbdb1ec28e4">$www_page_versions_id</a> &gt; 0) {</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        $a_page_versions = array();</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT pv.id,pv.date_inserted,a.fullname as author_fullname,pv.lk_content_status_id,pv.date_publish_start,pv.date_publish_end,e.fullname as editor_fullname &#39;</span> .</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;                <span class="stringliteral">&#39;FROM www_page_versions pv &#39;</span> .</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;                <span class="stringliteral">&#39;LEFT JOIN www_users a ON (pv.author_id = a.id) &#39;</span> .</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;                <span class="stringliteral">&#39;LEFT JOIN www_users e ON (pv.editor_id = e.id) &#39;</span> .</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                <span class="stringliteral">&#39;WHERE pv.www_pages_id = &#39;</span> . <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a2ee0dbecb1c2b92cf425284093e0542d">$www_pages_id</a> . <span class="charliteral">&#39; &#39;</span> .</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                <span class="stringliteral">&#39;ORDER BY pv.date_publish_start DESC&#39;</span>;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        <span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;                trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        }</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        $a_pv = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;GetRows();</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        <span class="keywordflow">foreach</span>($a_pv as $pv) {</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;                $version_id = $pv[<span class="stringliteral">&#39;id&#39;</span>];</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;                <a class="code" href="../../d2/d6e/ajax__about__form_8php.html#a17c8948c68aa44fa9961ae169b6a8961">$version</a> = <span class="charliteral">&#39;(&#39;</span> . <a class="code" href="../../d8/dfd/utils_8php.html#a741e472b16682ea77137ca19054c17b8">date_decode</a>($pv[<span class="stringliteral">&#39;date_inserted&#39;</span>], <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a8ada2a3347c63cf1058071243b769c6c">$user_tz</a>, <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ab74db288cd92349906022ba161ff1043">$user_df_php_datetime</a>) . <span class="stringliteral">&#39;) &#39;</span> .</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                        <a class="code" href="../../d5/dd6/gettext__missing_8php.html#a3c20d7b28b08b0ee319c8dffdc979b75">gettext</a>(<span class="stringliteral">&#39;Submitted from&#39;</span>) . <span class="stringliteral">&#39;: &#39;</span> . $pv[<span class="stringliteral">&#39;author_fullname&#39;</span>] . <span class="stringliteral">&#39;. &#39;</span> .</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;                        <a class="code" href="../../d5/dd6/gettext__missing_8php.html#a3c20d7b28b08b0ee319c8dffdc979b75">gettext</a>(<span class="stringliteral">&#39;Published from&#39;</span>) . <span class="stringliteral">&#39;: &#39;</span> . <a class="code" href="../../d8/dfd/utils_8php.html#a741e472b16682ea77137ca19054c17b8">date_decode</a>($pv[<span class="stringliteral">&#39;date_publish_start&#39;</span>], <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a8ada2a3347c63cf1058071243b769c6c">$user_tz</a>, <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ab74db288cd92349906022ba161ff1043">$user_df_php_datetime</a>) .</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;                        ($pv[<span class="stringliteral">&#39;date_publish_end&#39;</span>] ? <span class="charliteral">&#39; &#39;</span> . <a class="code" href="../../d5/dd6/gettext__missing_8php.html#a3c20d7b28b08b0ee319c8dffdc979b75">gettext</a>(<span class="stringliteral">&#39;until&#39;</span>) . <span class="charliteral">&#39; &#39;</span> . <a class="code" href="../../d8/dfd/utils_8php.html#a741e472b16682ea77137ca19054c17b8">date_decode</a>($pv[<span class="stringliteral">&#39;date_publish_end&#39;</span>], <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a8ada2a3347c63cf1058071243b769c6c">$user_tz</a>, <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#ab74db288cd92349906022ba161ff1043">$user_df_php_datetime</a>) : <span class="stringliteral">&#39;&#39;</span>) .</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;                        <span class="stringliteral">&#39;. &#39;</span> .</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;                        <a class="code" href="../../d5/dd6/gettext__missing_8php.html#a3c20d7b28b08b0ee319c8dffdc979b75">gettext</a>(<span class="stringliteral">&#39;Content status&#39;</span>) . <span class="stringliteral">&#39;: &#39;</span> . <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a75dbf76c56d09cf17ff2168c80e91220">$a_content_status</a>[$pv[<span class="stringliteral">&#39;lk_content_status_id&#39;</span>]] . <span class="stringliteral">&#39;. &#39;</span> .</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;                        ($pv[<span class="stringliteral">&#39;editor_fullname&#39;</span>] ? <a class="code" href="../../d5/dd6/gettext__missing_8php.html#a3c20d7b28b08b0ee319c8dffdc979b75">gettext</a>(<span class="stringliteral">&#39;Managed by&#39;</span>) . <span class="stringliteral">&#39;: &#39;</span> . $pv[<span class="stringliteral">&#39;editor_fullname&#39;</span>] . <span class="charliteral">&#39;.&#39;</span> : <span class="stringliteral">&#39;&#39;</span>);</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#af1dbb25ca2c1c607bc85ea9a9e75c4cd">$lk_content_status_id</a> = $pv[<span class="stringliteral">&#39;lk_content_status_id&#39;</span>];</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;                <a class="code" href="../../d0/da7/ajax__login__form_8php.html#adc8bae1307e95ecc92278dd60d382c25">$a_tmp</a> = array(</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;                        <span class="stringliteral">&#39;version_id&#39;</span> =&gt; $version_id,</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                        <span class="stringliteral">&#39;version&#39;</span> =&gt; <a class="code" href="../../d2/d6e/ajax__about__form_8php.html#a17c8948c68aa44fa9961ae169b6a8961">$version</a>,</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                        <span class="stringliteral">&#39;content_status&#39;</span> =&gt; <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#af1dbb25ca2c1c607bc85ea9a9e75c4cd">$lk_content_status_id</a></div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;                );</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;                array_push($a_page_versions, <a class="code" href="../../d0/da7/ajax__login__form_8php.html#adc8bae1307e95ecc92278dd60d382c25">$a_tmp</a>);</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;        }</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;        <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;page_versions&#39;</span>] = $a_page_versions;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;}</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="comment">// authors ---------------------------------------------------------------------</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a047170d6020a882807665812a27e2525">  154</a></span>&#160;<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, fullname FROM www_users ORDER BY fullname&#39;</span>;</div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a801399e74a9ffbd3985c323da20bb59e">  155</a></span>&#160;<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;<span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;        trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;}</div>
<div class="line"><a name="l00159"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9567ce59e7fe458d403bdd3a235388ab">  159</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;authors&#39;</span>] = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;GetRows();</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="comment">// editors ---------------------------------------------------------------------</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> = <span class="stringliteral">&#39;SELECT id, fullname FROM www_users WHERE lk_roles_id &lt; &#39;</span> . <a class="code" href="../../d6/d75/init_8php.html#a509989100eeeba947f7f6b69a1ce8dcf">CONST_ROLE_AUTHOR_KEY</a> . <span class="stringliteral">&#39; ORDER BY fullname&#39;</span>;</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> = <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Execute(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a>);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a> === <span class="keyword">false</span>) {</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        trigger_error(<span class="stringliteral">&#39;Wrong SQL: &#39;</span> . <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a047170d6020a882807665812a27e2525">$sql</a> . <span class="stringliteral">&#39; Error: &#39;</span> . <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;ErrorMsg(), E_USER_ERROR);</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;}</div>
<div class="line"><a name="l00167"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a8dbc33ecd8884e288c4d0ef521a407ab">  167</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;editors&#39;</span>] = <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;GetRows();</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="comment">// content status --------------------------------------------------------------</span></div>
<div class="line"><a name="l00170"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a6fd8cee9ad282c5c72dfef1ce136cbef">  170</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;content_status_keys&#39;</span>] = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#ab7d298e479fe6080b840eb3e44be9039">$a_content_status_keys</a>;</div>
<div class="line"><a name="l00171"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a6217020a1e69c9b81da06169e1cc1f4f">  171</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;content_status_values&#39;</span>] = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aac299996d4de21e8bce2663b75f7f1c1">$a_content_status_values</a>;</div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a897758bf7142edab8f580f77098bb03d">  172</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;content_status_css&#39;</span>] = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#abcaa38a389fb572018ed3d050209615c">$a_content_status_css</a>;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="comment">// page version content --------------------------------------------------------</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="comment">// get template</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a7d6a2c15b45ad61216139b285de3856a">  176</a></span>&#160;<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a7d6a2c15b45ad61216139b285de3856a">$a_template</a> = <a class="code" href="../../d6/dfd/utils__cms_8php.html#a9f54a511e68e3e64b7c61ecd1c908989">get_page_template</a>(<a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>, <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a2ee0dbecb1c2b92cf425284093e0542d">$www_pages_id</a>, <a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a749423b4cd05e9c9af3474b05bec92c2">$dt</a>);</div>
<div class="line"><a name="l00177"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#af3275005006cea4174b9c60706576b73">  177</a></span>&#160;<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#af3275005006cea4174b9c60706576b73">$www_templates_id</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a7d6a2c15b45ad61216139b285de3856a">$a_template</a>[<span class="stringliteral">&#39;template_id&#39;</span>];</div>
<div class="line"><a name="l00178"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ba5b535b139c92dc36ac5c9b8c18186">  178</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ba5b535b139c92dc36ac5c9b8c18186">$template_path</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a7d6a2c15b45ad61216139b285de3856a">$a_template</a>[<span class="stringliteral">&#39;template_path&#39;</span>];</div>
<div class="line"><a name="l00179"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a81a0f5ac832f9296d427080af9383791">  179</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a81a0f5ac832f9296d427080af9383791">$template_file</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a7d6a2c15b45ad61216139b285de3856a">$a_template</a>[<span class="stringliteral">&#39;template_file&#39;</span>];</div>
<div class="line"><a name="l00180"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a17fffe823c0351a4c73f199924a0f641">  180</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a17fffe823c0351a4c73f199924a0f641">$css_url</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a7d6a2c15b45ad61216139b285de3856a">$a_template</a>[<span class="stringliteral">&#39;css_url&#39;</span>];</div>
<div class="line"><a name="l00181"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a31474d1b2daf374055a779407b85e01f">  181</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a31474d1b2daf374055a779407b85e01f">$template_base_url</a> = <a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>[<span class="stringliteral">&#39;project_url&#39;</span>] . <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ba5b535b139c92dc36ac5c9b8c18186">$template_path</a>;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;<span class="comment">// store template html to variable</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;ob_start();</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;include(<a class="code" href="../../de/dc4/settings_8dist_8php.html#af21c418e4c577deb3a9ea7299156ae35">$tolc_conf</a>[<span class="stringliteral">&#39;project_dir&#39;</span>] . <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ba5b535b139c92dc36ac5c9b8c18186">$template_path</a> . <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a81a0f5ac832f9296d427080af9383791">$template_file</a>);</div>
<div class="line"><a name="l00186"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a57baa857d461b32a203cfbfd41cc57d1">  186</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a57baa857d461b32a203cfbfd41cc57d1">$template_html</a> = ob_get_contents();</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;ob_end_clean();</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="comment">// create a DOM object</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">  190</a></span>&#160;<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a> = <span class="keyword">new</span> simple_html_dom();</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;<span class="comment">// load template html</span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;load(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a57baa857d461b32a203cfbfd41cc57d1">$template_html</a>);</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="comment">// set template elements src attribute relevant to website root</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a> = <a class="code" href="../../d6/dfd/utils__cms_8php.html#a6b786ebb8257b1815166cdaa1f7f1a2c">set_template_src_attribute</a>(<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>, <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a31474d1b2daf374055a779407b85e01f">$template_base_url</a>);</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<span class="comment">// set page content</span></div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a> = <a class="code" href="../../d6/dfd/utils__cms_8php.html#af1067f0f5a7357c706ca40d229d1f4ac">set_page_version_content</a>(<a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>, <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#aaf6b59bede49d73754040dbdb1ec28e4">$www_page_versions_id</a>, <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#af3275005006cea4174b9c60706576b73">$www_templates_id</a>, <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>);</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;<span class="comment">// remove page head</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a3fa5daa9b33de505536babe6cb14648e">  202</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a3fa5daa9b33de505536babe6cb14648e">$template_head</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;getElementByTagName(<span class="stringliteral">&#39;head&#39;</span>);</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;<span class="keywordflow">if</span>(<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a3fa5daa9b33de505536babe6cb14648e">$template_head</a>) {</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;        <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a3fa5daa9b33de505536babe6cb14648e">$template_head</a>-&gt;outertext = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;}</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;<span class="comment">// store DOM object to variable</span></div>
<div class="line"><a name="l00208"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ca634d35b7303d66524b74dfd8ea508">  208</a></span>&#160;<a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ca634d35b7303d66524b74dfd8ea508">$page_html</a> = <a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;save();</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;<span class="comment">// clear DOM object</span></div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;<a class="code" href="../../db/d3f/ajax__addnew__page__version_8php.html#a6f96e7fc92441776c9d1cd3386663b40">$html</a>-&gt;clear();</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;</div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#ac7a293474515e7fc2d4b2ef25f257046">  213</a></span>&#160;<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>[<span class="stringliteral">&#39;html&#39;</span>] = <a class="code" href="../../d9/d37/ajax__load__page__version_8php.html#a9ca634d35b7303d66524b74dfd8ea508">$page_html</a>;</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;<span class="comment">// -----------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;<span class="comment">// free memory from database objects</span></div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="keywordflow">if</span>(<a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>)</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;        <a class="code" href="../../d0/d3d/ajax__new__page_8php.html#a801399e74a9ffbd3985c323da20bb59e">$rs</a>-&gt;Close();</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;<span class="comment">//database disconnect</span></div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;<span class="keywordflow">if</span>(<a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>)</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <a class="code" href="../../d5/d3e/ajax__autocomplete__parent__title_8php.html#aa8a5a87b9c1a6a0819b88447cbe41877">$conn</a>-&gt;Close();</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;<span class="comment">// -----------------------------------------------------------------------------</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;print json_encode(<a class="code" href="../../d7/da6/ajax__datetime__range_8php.html#a021631687090fc455607ae336ebc3b54">$a_res</a>);</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;?&gt;</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../dir_d422163b96683743ed3963d4aac17747.html">app</a></li><li class="navelem"><a class="el" href="../../dir_04bb458943ba1ea9da78306bf6170bdc.html">admin</a></li><li class="navelem"><a class="el" href="../../dir_648652d4c91e30e22fa3572c6ab2f89e.html">rte</a></li><li class="navelem"><a class="el" href="../../d9/d37/ajax__load__page__version_8php.html">ajax_load_page_version.php</a></li>
    <li class="footer">Generated on Fri Aug 31 2012 22:06:31 for Tolc by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.2 </li>
  </ul>
</div>
</body>
</html>
